package cn.wolfcode.domain;

import cn.wolfcode.enums.NoticeLevelEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Getter
@Setter
@ToString
public class Notice {
    /** id*/
    private Long id;

    /** 标题*/
    private String title;

    /** 内容*/
    private String content;

    /** 创建人id*/
    private Employee createEmp;

    /** 创建时间*/
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 公告级别*/
    private Integer level = 2;

    /** 发布状态*/
    private boolean issueStatus = false;

    //获取level对应的name
    public String getLevelName(){
        return NoticeLevelEnum.findName(level);
    }

    //是否已读
    private boolean readStatus;
}